# coding=utf-8
# !/usr/bin/python3
import json

import execjs
import requests

cookies = {
    '_zap': '09bea9e8-aef9-4b2b-b8a9-e8ee8ae014dd',
    'd_c0': 'ANCUGWngehePTrHB0lWft8JsMBpab0l2lR0=|1696163100',
    'YD00517437729195%3AWM_TID': '3tGLgHtM7ttBUUBRFRPQzL2fTx5qvqDY',
    '__snaker__id': 'RH5hqxbMClNACxkE',
    'YD00517437729195%3AWM_NI': 'SRkiR8lWOvyFHNIhHpG4vIOgK3TVf1h2Fg%2FZlqUWZ0fmIW5XBsLbyXQ2wNSzuAafDifZF0mP5kMt0E6pSDgNAeqy1LVabd%2FDUxLMdqHOaWW4fm95J8CFf4R%2FrpscbOjbQ04%3D',
    'YD00517437729195%3AWM_NIKE': '9ca17ae2e6ffcda170e2e6eed0cf6298bda2a6ce4b89eb8ba7d84f928b9bb0c467a58e0099f83fb092b795ed2af0fea7c3b92a918ea58ad134b0898197fc4e8c928789cb7c85ecbaaace6d89ed9cb7e53bacee8a88ae52b0af9bb8d93ca6b387b8b85482ad8483fc5493eeb9afd272b79faf87c763a6868ad1f05cf7b58395b34ff6b09da5e64683bbbf9ab44896bfae85ae5097a884aee77b8c91afb8d640a6b3f7d6c934819aaad5d125b2b0bd84e145aabe9fd1b737e2a3',
    '_xsrf': 'UpXZ7M4bxCXxv08abThOzJy9Xuvt1dlv',
    'captcha_session_v2': '2|1:0|10:1725720485|18:captcha_session_v2|88:UFFJNmJ1TTFrbDlLZlhsdmFtVDVSaHpZQmF5MlkxTWFqeThhTlowYXJLbk5RT2ZsZUtmWnlrb1hDMlRDOThWYg==|6a917191e70e024acc4fdb40aaaf28fba6306d81c61b2b80587f1c41ecd65820',
    'Hm_lvt_98beee57fd2ef70ccdd5ca52b9740c49': '1725720485',
    'HMACCOUNT': 'AA269697F43B56EA',
    'SESSIONID': 'e0z9R74SHuEJ3UYHm4w2m6g1eBJEqeFFPIZpc8WFzKA',
    'JOID': 'UFwcBkziPiGkG5WNL-Wdvgt-cvQzgQNXn0yktHCvTWniKsXSak5Y88UYnowhsBuK8JL2aEaROkzvtB9Mq7iFL5c=',
    'osd': 'VFwdAknmPiCgHpGNLuGYugt_dvE3gQJTmkiktXSqSWnjLsDWak9c9sEYn4gktBuL9JfyaEeVP0jvtRtJr7iEK5I=',
    'gdxidpyhxdE': 'USb19HmM0Yj%5C7MeLg%2BHqq%2FE4izMzwlxRxh895ngNVZSMk%2FAGbJEhzpNAGlBHuBONAc9EvjbL2JCUHasHyVtyfO7cJKWWuGDqvu8jo0TPgevRHDhO0KeWGVo%2BHxM69cgZpMzV8E7%5CduJzoeJ7H12v2WCs0DZ5ZpjpM3ZSEV%5CbDV0JbWju%3A1725721386475',
    'o_act': 'login',
    'ref_source': 'other_https://www.zhihu.com/signin?next=/',
    'expire_in': '15552000',
    'q_c1': '24ba191185a14869b2fc35517deb2742|1725720511000|1725720511000',
    'Hm_lpvt_98beee57fd2ef70ccdd5ca52b9740c49': '1725720511',
    'tst': 'r',
    'BEC': 'ec64a27f4feb1b29e8161db426d61998',
    'z_c0': '2|1:0|10:1725720514|4:z_c0|92:Mi4xdXoyclF3QUFBQUFBMEpRWmFlQjZGeGNBQUFCZ0FsVk52N1hKWndCNFgzYl9oSVdtcUVNMU1GYWtIaW1TMXJYNWh3|0b01d6c59e758bb4c7567ce436a983a2c3cd22c0ae6f478e5cfb2b1a5f56d1a3',
    'unlock_ticket': 'AFBTwXdzUxYXAAAAYAJVTctu3GZvnclNj3gJLDsJ2LFYWKUtlNkGjg==',
}

headers = {
    'accept': '*/*',
    'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
    # 'cookie': '_zap=09bea9e8-aef9-4b2b-b8a9-e8ee8ae014dd; d_c0=ANCUGWngehePTrHB0lWft8JsMBpab0l2lR0=|1696163100; YD00517437729195%3AWM_TID=3tGLgHtM7ttBUUBRFRPQzL2fTx5qvqDY; __snaker__id=RH5hqxbMClNACxkE; YD00517437729195%3AWM_NI=SRkiR8lWOvyFHNIhHpG4vIOgK3TVf1h2Fg%2FZlqUWZ0fmIW5XBsLbyXQ2wNSzuAafDifZF0mP5kMt0E6pSDgNAeqy1LVabd%2FDUxLMdqHOaWW4fm95J8CFf4R%2FrpscbOjbQ04%3D; YD00517437729195%3AWM_NIKE=9ca17ae2e6ffcda170e2e6eed0cf6298bda2a6ce4b89eb8ba7d84f928b9bb0c467a58e0099f83fb092b795ed2af0fea7c3b92a918ea58ad134b0898197fc4e8c928789cb7c85ecbaaace6d89ed9cb7e53bacee8a88ae52b0af9bb8d93ca6b387b8b85482ad8483fc5493eeb9afd272b79faf87c763a6868ad1f05cf7b58395b34ff6b09da5e64683bbbf9ab44896bfae85ae5097a884aee77b8c91afb8d640a6b3f7d6c934819aaad5d125b2b0bd84e145aabe9fd1b737e2a3; _xsrf=UpXZ7M4bxCXxv08abThOzJy9Xuvt1dlv; captcha_session_v2=2|1:0|10:1725720485|18:captcha_session_v2|88:UFFJNmJ1TTFrbDlLZlhsdmFtVDVSaHpZQmF5MlkxTWFqeThhTlowYXJLbk5RT2ZsZUtmWnlrb1hDMlRDOThWYg==|6a917191e70e024acc4fdb40aaaf28fba6306d81c61b2b80587f1c41ecd65820; Hm_lvt_98beee57fd2ef70ccdd5ca52b9740c49=1725720485; HMACCOUNT=AA269697F43B56EA; SESSIONID=e0z9R74SHuEJ3UYHm4w2m6g1eBJEqeFFPIZpc8WFzKA; JOID=UFwcBkziPiGkG5WNL-Wdvgt-cvQzgQNXn0yktHCvTWniKsXSak5Y88UYnowhsBuK8JL2aEaROkzvtB9Mq7iFL5c=; osd=VFwdAknmPiCgHpGNLuGYugt_dvE3gQJTmkiktXSqSWnjLsDWak9c9sEYn4gktBuL9JfyaEeVP0jvtRtJr7iEK5I=; gdxidpyhxdE=USb19HmM0Yj%5C7MeLg%2BHqq%2FE4izMzwlxRxh895ngNVZSMk%2FAGbJEhzpNAGlBHuBONAc9EvjbL2JCUHasHyVtyfO7cJKWWuGDqvu8jo0TPgevRHDhO0KeWGVo%2BHxM69cgZpMzV8E7%5CduJzoeJ7H12v2WCs0DZ5ZpjpM3ZSEV%5CbDV0JbWju%3A1725721386475; o_act=login; ref_source=other_https://www.zhihu.com/signin?next=/; expire_in=15552000; q_c1=24ba191185a14869b2fc35517deb2742|1725720511000|1725720511000; Hm_lpvt_98beee57fd2ef70ccdd5ca52b9740c49=1725720511; tst=r; BEC=ec64a27f4feb1b29e8161db426d61998; z_c0=2|1:0|10:1725720514|4:z_c0|92:Mi4xdXoyclF3QUFBQUFBMEpRWmFlQjZGeGNBQUFCZ0FsVk52N1hKWndCNFgzYl9oSVdtcUVNMU1GYWtIaW1TMXJYNWh3|0b01d6c59e758bb4c7567ce436a983a2c3cd22c0ae6f478e5cfb2b1a5f56d1a3; unlock_ticket=AFBTwXdzUxYXAAAAYAJVTctu3GZvnclNj3gJLDsJ2LFYWKUtlNkGjg==',
    'priority': 'u=1, i',
    'referer': 'https://www.zhihu.com/',
    'sec-ch-ua': '"Chromium";v="128", "Not;A=Brand";v="24", "Microsoft Edge";v="128"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'sec-fetch-dest': 'empty',
    'sec-fetch-mode': 'cors',
    'sec-fetch-site': 'same-origin',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
    'x-api-version': '3.0.53',
    'x-requested-with': 'fetch',
    'x-zse-93': '101_3_3.0',
    'x-zse-96': '2.0_KN4O/0LKsMhALK4yVJCL5RkcKr=bCFlqpAcNGIuGch8ZuLYjvBy=nmYs1q=3WjXr',
    'x-zst-81': '3_2.0aR_sn77yn6O92wOB8hPZnQr0EMYxc4f18wNBUgpTQ6nxERFZfTY0-4Lm-h3_tufIwJS8gcxTgJS_AuPZNcXCTwxI78YxEM20s4PGDwN8gGcYAupMWufIeQuK7AFpS6O1vukyQ_R0rRnsyukMGvxBEqeCiRnxEL2ZZrxmDucmqhPXnXFMTAoTF6RhRuLPF8XYBRYYyrL0owY_ACc9fBNL9vr8qcHK0GHmRDg_ucwOqCg_Owe_BAxCBhrTvHepZCL1GT3feUpGSDNx_BCB-wOKNuOy0Cp1eJSBK6OOwgCyFgY_UGw9BrH1EcoLrqgMeJO1ucxCIJoB2LXVHvwGqCVOpvwYyGHOTGS_tuCmEwL_HGpmOqfz-uofZJcqrJHO6CpG_CXLCGe1UhFs1gF9pheMEwLOWwSsFgtBACL8YDpy09pVV9wMvqYGJqCCJqgLoGNKFvwB6BeBShO1zgXLvDwfirr__gxOQXXCK8LC',
}


params = {
    'limit': '10',
    'desktop': 'true',
}

response = requests.get('https://www.zhihu.com/api/v3/feed/topstory/recommend', params=params, cookies=cookies, headers=headers).json()
print(json.dumps(response, ensure_ascii=False, indent=4))